package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.DstNewrankArticleDTO;
import com.financing.wap.dao.IDstNewrankArticleDao;
import com.financing.wap.common.SqlName;
/**
 * dst_newrank_article  
 * 抓取热文列表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstNewrankArticleDao")
public class DstNewrankArticleDaoImpl extends BaseDaoImpl<DstNewrankArticleDTO, java.lang.Integer> implements IDstNewrankArticleDao {


	@Override
	public int insert(DstNewrankArticleDTO dstNewrankArticle) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstNewrankArticleSql.insert, dstNewrankArticle);
	}

	@Override
	public void update(DstNewrankArticleDTO dstNewrankArticle) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstNewrankArticleSql.update, dstNewrankArticle);
	}

	@Override
	public void updateForce(DstNewrankArticleDTO dstNewrankArticle) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstNewrankArticleSql.updateForce, dstNewrankArticle);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstNewrankArticleSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstNewrankArticleDTO> queryList(DstNewrankArticleDTO dstNewrankArticle) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstNewrankArticleSql.queryList, dstNewrankArticle);
	}

	@Override
	public int queryListCount(DstNewrankArticleDTO dstNewrankArticle) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstNewrankArticleSql.queryListCount, dstNewrankArticle);
	}

	@Override
	public DstNewrankArticleDTO loadById(Integer id) throws SQLException {
		return  (DstNewrankArticleDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstNewrankArticleSql.loadById,id);
	}

	@Override
	public Class<DstNewrankArticleDTO> getEntityClass() {
		return DstNewrankArticleDTO.class;
	}
 	
}
